package com.example.jetpacker.lifecycles

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.jetpacker.R

/**
 * 感知activity、fragment生命周期
 * 在Activity中嵌入一个隐藏的Fragment来进行感知，或者通过手写监听器的方式来进行感知
 */
@Route(path = "/jetpack/lifecycles/one")
class LifecycleOneActivity : AppCompatActivity(){

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.act_splash)
//        lifecycle.addObserver(MyObserverOne())
        lifecycle.addObserver(MyObserverTwo(lifecycle))
    }
}